package com.takeaway.dao.daolmpl;

import com.takeaway.dao.daointerface.CartDao;
import com.takeaway.pojo.Cart;
import com.takeaway.utils.JdbcUtils;

import java.util.ArrayList;

/**
 * @author 后台赖骏
 */
public class CartDaoImpl implements CartDao {
    @Override
    public int insert(Cart cart) throws Exception{
        return JdbcUtils.insert(cart);
    }

    @Override
    public int delete(Class<Cart> clz, String[] checkField, Object... factor) throws Exception{
        return JdbcUtils.delete(clz,checkField,factor);
    }

    @Override
    public int update(Cart cart) throws Exception{
        return JdbcUtils.update(cart);
    }

    @Override
    public Cart selectSingle(Cart cart, String[] checkFields, Object... factor) throws Exception{
        return (Cart) JdbcUtils.selectSingle(cart,checkFields,factor);
    }

    @Override
    public ArrayList<Cart> selectMore(Class<Cart> clz,int begin,int listNum) throws Exception{
        return (ArrayList<Cart>) JdbcUtils.selectMore(clz,begin,listNum);
    }

    @Override
    public ArrayList<Cart> selectMore(Class<Cart> clz, String[] checkField, Object... factor) throws Exception{
        return (ArrayList<Cart>) JdbcUtils.selectMore(clz,checkField,factor);
    }
}
